<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>使用flex实现瀑布流</title>
  <style>
    .masonry {
      height: 800px;
      display: flex;
      flex-flow: column wrap;
      width: 80%;
      margin: 2em auto;
    }
  </style>
</head>

<body>
  <div class="masonry">
    <div class="item">
      <div class="item_content content-lar">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-sma">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-mid">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-sma">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-mid">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-lar">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-sma">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-lar">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-lar">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-sma">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-mid">
      </div>
    </div>
    <div class="item">
      <div class="item_content content-mid">
      </div>
    </div>
    <!-- more items -->
    <!-- 
      这个功能中最重点的是css思维，平常我们考虑的flex方向肯定是向右加载，但是当碰到有一个元素高度更高时，就要考虑将flex的方向转向column，然后控制高度为最高的那个高度，就可以实现了
     -->
  </div>
</body>

</html>